Early Preview

This is currently very much a preview. Please feel free to try things out, but don't be upset if anything is not yet working. Feedback is welcome over on our GitHub Dicussions page.

interface System.​Collections.​Generic.​IComparer<​T>

Assembly: System.Runtime

Defines a method that a type implements to compare two objects.

Methods

int
Compare​(T x, T y)
Compares two objects and returns a value indicating whether one is less than, equal to, or greater than the other.
Returns A signed integer that indicates the relative values of <paramref name="x" /> and <paramref name="y" /> , as shown in the following table. <list type="table"> <listheader> <term> Value</term> <description> Meaning</description> </listheader> <item> <term> Less than zero</term> <description> <paramref name="x" /> is less than <paramref name="y" />.</description> </item> <item> <term> Zero</term> <description> <paramref name="x" /> equals <paramref name="y" />.</description> </item> <item> <term> Greater than zero</term> <description> <paramref name="x" /> is greater than <paramref name="y" />.</description> </item> </list>
x The first object to compare.
y The second object to compare.